<?php
/**
 * Created by PhpStorm.
 * User: Quyet
 * Date: 12/5/2014
 * Time: 1:33 PM
 */
    session_start();
include "../db/dbConnect.php";
    $sql="update u_user set online=0 where iduser=".$_SESSION['LoginData']["iduser"];
    if(!mysql_query($sql))
        echo mysql_error();
    // remove all session variables
    session_unset();

    // destroy the session
    session_destroy();
    header('location: ../index.php');
?>